package com.trailer.base.ext

import android.content.DialogInterface
import com.qmuiteam.qmui.widget.dialog.QMUIDialog
import com.qmuiteam.qmui.widget.dialog.QMUIDialog.MenuBaseDialogBuilder
import com.qmuiteam.qmui.widget.dialog.QMUIDialogMenuItemView.MarkItemView


inline fun QMUIDialog.CheckableDialogBuilder.addArrItems(items: List<String>?, listener: DialogInterface.OnClickListener?): QMUIDialog.CheckableDialogBuilder {

    items?.forEach {
        addItem(MenuBaseDialogBuilder.ItemViewFactory { context -> MarkItemView(context, it) }, listener)
    }

    return this
}
